﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:z="#RowsetSchema"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    exclude-result-prefixes="msxsl"
>
  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="/z:row">
    <entry xmlns="http://www.w3.org/2005/Atom">
      <title>
        <xsl:value-of select="@ows_Title"/>
      </title>
      <link rel="alternate" type="text/html">
        <xsl:attribute name="href">
          <xsl:value-of select="@ows_EncodedAbsUrl"/>
        </xsl:attribute>
      </link>
      <id>
        urn:uuid:<xsl:value-of select='translate(substring-before(substring-after(@ows_GUID, "{"), "}"), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")'/>
      </id>
      <updated>
        <xsl:value-of select='concat(substring-before(@ows_Modified, " "), "T", substring-after(@ows_Modified, " "), "Z")'/>
      </updated>
      <xsl:for-each select="@*">
        <xsl:element name="z:{name(.)}" namespace="#RowsetSchema">
          <xsl:value-of select="." />
        </xsl:element>
      </xsl:for-each>
    </entry>
  </xsl:template>
</xsl:stylesheet>
